<?php

/**
 * Article form.
 *
 * @package    theconnexter
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ArticleForm extends BaseArticleForm{

	public function configure(){
		unset($this['created_at'],$this['updated_at'], $this['slug']);
		$this->widgetSchema['resume']=new sfWidgetFormTextareaFCK(
			array(),
			array('height'=>'200','width'=>'800'
		));
		$this->widgetSchema['contenu']=new sfWidgetFormTextareaFCK(
			array(),
			array('height'=>'600','width'=>'800'
		));
		
		$dateWidget = new sfWidgetFormI18nDate(array(
			'format' => '%day%/%month%/%year%',
			'month_format' => 'short_name',
			'culture' => 'fr'));
		
		$this->widgetSchema['dateExpiration'] = new sfWidgetFormJQueryDate(array(
			'image'  => '/images/calendar2.png',
			'culture'=> 'fr',
			'date_widget' => $dateWidget
        ));
                $this->widgetSchema['jointFile'] = new sfWidgetFormInputFileEditable(array(
			'label'			=> 'Documents Joint',
			'file_src'		=> '/uploads/article/'.$this->getObject()->getJointFile(),
			'edit_mode'		=> !$this->isNew(),
			'template'		=> '<div>%file%<br /><br /><br />%input%<br /><br /><div>%delete% %delete_label%</div></div>',
		));
                $this->validatorSchema['jointFile'] = new sfValidatorFile(array(
		  'required'   => false,
		  'path'       => sfConfig::get('sf_upload_dir').'/article',
		  'mime_types' => array('application/pdf','application/zip'),
		));
	}
}
